<?php
/**
*
* @package ppkBB3cker
* @version $Id: top.php 1.000 2010-04-19 10:54:00 PPK $
* @copyright (c) 2010 PPK
* @Based on Top v.2.0 for tt.u-l.ru (c) Boec
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

$user->add_lang('mods/ppkbb3cker_top');

if(!$config['ppkbb_tracker_top'])
{
	trigger_error($user->lang['TOP_DISABLED']);
}
if(!$auth->acl_get('u_canviewtrtop'))
{
	trigger_error($user->lang['TOP_NOAUTH']);
}
$start=$top_limit=$row_class=0;
$top_limit=$config['ppkbb_tracker_top'];
$top_inc=$phpbb_root_path.'tracker/top/';

$user->lang['TOP_BY_UPLOAD']=sprintf($user->lang['TOP_BY_UPLOAD'], $top_limit);
$user->lang['TOP_BY_RATIO']=sprintf($user->lang['TOP_BY_RATIO'], $top_limit);
$user->lang['TOP_BY_DOWNSUM']=sprintf($user->lang['TOP_BY_DOWNSUM'], $top_limit);
$user->lang['TOP_BY_AUTHOR']=sprintf($user->lang['TOP_BY_AUTHOR'], $top_limit);
$user->lang['TOP_BY_TORRENTS']=sprintf($user->lang['TOP_BY_TORRENTS'], $top_limit);
$user->lang['TOP_BY_TORRENTS_MONTH']=sprintf($user->lang['TOP_BY_TORRENTS_MONTH'], $top_limit);
$user->lang['TOP_BY_TORRENTS_WEEK']=sprintf($user->lang['TOP_BY_TORRENTS_WEEK'], $top_limit);

//
// Generate page
//

include("{$top_inc}top_by_ratio.{$phpEx}");

include("{$top_inc}top_by_upload.{$phpEx}");

include("{$top_inc}top_by_torrents.{$phpEx}");

include("{$top_inc}top_by_torrents_month.{$phpEx}");

include("{$top_inc}top_by_torrents_week.{$phpEx}");

include("{$top_inc}top_by_downsum.{$phpEx}");

include("{$top_inc}top_by_author.{$phpEx}");

page_header(sprintf($user->lang['TRACKER_TOP'], $config['ppkbb_tracker_top']));

$template->set_filenames(array(
	'body' => 'top_body.html')
);

page_footer();

?>
